package com.ego.order.controller;

import java.util.Arrays;

import com.ego.common.vo.BaseSearchVo;
import com.ego.common.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.ego.order.po.PaymentInfo;
import com.ego.order.service.PaymentInfoService;
import com.ego.common.util.Result;

import javax.validation.Valid;

/**
 * @program: ego
 * @description 支付信息表控制器
 * @author KamTang
 * @date 2022-11-13 11:25:07
 */
@RestController
@RequestMapping("order/payment-info")
public class PaymentInfoController {

    @Autowired
    private PaymentInfoService paymentInfoService;

    /**
     * 搜索
     */
    @PostMapping("/search")
    public Result search(@Valid @RequestBody BaseSearchVo search) {
        PageVo<PaymentInfo> page = paymentInfoService.search(search);
        return Result.ok().put("page", page);
    }

    /**
     * 删除
     */
    @PostMapping("/delete")
    public Result delete(@RequestBody Long[] ids){
		paymentInfoService.removeByIds(Arrays.asList(ids));
        return Result.ok();
    }

}
